﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace STKMIS.Model
{
    /// <summary>
    /// 产品单位的实体类
    /// </summary>
    [Serializable]
    public class ProductsAndUnitModel
    {
        // 常量
        public const string tableName = "ProductsAndUnit";
        public const string primaryKeyName = "ProductsAndUnitID";

        // 成员变量
        private int _productsAndUnitID;
        private int _purchaseItemID;
        private int _productID;
        private int _productUnitID;
        private decimal _productSumAmount;
        private decimal _productNowAmount;
        private decimal _purchaseprice;
        private DateTime _purchaseTime;
        private Boolean _isDeleted;

        /// <summary>
        /// 字段名结构
        /// <summary>
        public struct FieldName
        {
            public const string productsAndUnitID = "ProductsAndUnitID";
            public const string purchaseItemID = "PurchaseItemID";
            public const string productID = "ProductID";
            public const string productUnitID = "ProductUnitID";
            public const string productNowAmount = "ProductNowAmount";
            public const string productSumAmount = "ProductSumAmount";
            public const string purchaseprice = "PurchasePrice";
            public const string purchaseTime = "PurchaseTime";
            public const string isDeleted = "IsDeleted";
        }

        /// <summary>
        /// 默认构造函数
        /// <summary>
        public ProductsAndUnitModel() { }

        /// <summary>
        /// 带参构造函数
        /// <summary>
        ///<param name="productsAndUnitID">产品和单位关系主键ID</param>
        ///<param name="purchaseItemID">采购ID</param>
        ///<param name="productID">产品ID</param>
        ///<param name="productUnitID">产品单位</param>
        ///<param name="productAmount">产品数量</param>
        ///<param name="purchaseprice">产品单价</param>
        ///<param name="isDeleted">是否已删除</param>
        public ProductsAndUnitModel(int productsAndUnitID, int purchaseItemID, int productID, int productUnitID, decimal productNowAmount, decimal productSumAmount, decimal purchaseprice,DateTime purchaseTime, Boolean isDeleted)
        {
            this._productsAndUnitID = productsAndUnitID;
            this._purchaseItemID = purchaseItemID;
            this._productID = productID;
            this._productUnitID = productUnitID;
            this._productNowAmount = productNowAmount;
            this._productSumAmount = productSumAmount;
            this._purchaseprice = purchaseprice;
            this._purchaseTime = purchaseTime;
            this._isDeleted = isDeleted;
        }

        /// <summary>
        /// 产品和单位关系主键ID
        /// <summary>
        public int ProductsAndUnitID
        { 
            get { return _productsAndUnitID; }
            set { _productsAndUnitID = value; }
        }

        /// <summary>
        /// 采购ID
        /// <summary>
        public int PurchaseItemID
        { 
            get { return _purchaseItemID; }
            set { _purchaseItemID = value; }
        }

        /// <summary>
        /// 产品ID
        /// <summary>
        public int ProductID
        { 
            get { return _productID; }
            set { _productID = value; }
        }

        /// <summary>
        /// 产品单位
        /// <summary>
        public int ProductUnitID
        { 
            get { return _productUnitID; }
            set { _productUnitID = value; }
        }

        /// <summary>
        /// 产品单位名称
        /// <summary>
        public string ProductUnitName
        {
            get;
            set;
        }
        /// <summary>
        /// 一个主单位=PerAmount个其他单位
        /// </summary>
        public decimal PerAmount
        {
            get;
            set;
        }
        /// <summary>
        /// 产品现有数量
        /// <summary>
        public decimal ProductNowAmount
        { 
            get { return _productNowAmount; }
            set { _productNowAmount = value; }
        }

        /// <summary>
        /// 产品总数量数量
        /// <summary>
        public decimal ProductSumAmount
        {
            get { return _productSumAmount; }
            set { _productSumAmount = value; }
        }

        /// <summary>
        /// 产品单价
        /// <summary>
        public decimal PurchasePrice
        { 
            get { return _purchaseprice; }
            set { _purchaseprice = value; }
        }
        /// <summary>
        /// 采购时间
        /// <summary>
        public DateTime PurchaseTime
        {
            get { return _purchaseTime; }
            set { _purchaseTime = value; }
        }

        /// <summary>
        /// 是否已删除
        /// <summary>
        public Boolean IsDeleted
        { 
            get { return _isDeleted; }
            set { _isDeleted = value; }
        }
    }
}
